package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.StageWorkEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 阶段工作dao层接口
 *
 * @author haibin.zhang
 * @date 2019-02-13 13:50
 */
@Repository
@Mapper
public interface StageWorkDao {

    List<StageWorkEntity> findEntitys(@Param("param") Map<String,Object> param);

    void insertBatch(List<StageWorkEntity> workList);

    void deleteBatch(@Param("idIn") List<Long> dbWorkIdList);

    Integer insert(StageWorkEntity entity);

    Integer update(StageWorkEntity entity);

    void updateBatch(@Param("list") List<StageWorkEntity> list,@Param("corpid") String corpid);

    void updateBatch4MirrorRollback(@Param("list") List<StageWorkEntity> list,@Param("corpid") String corpid);

    void updateBatch4Script(@Param("list") List<StageWorkEntity> list);

     StageWorkEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

    Integer sort(@Param("corpid") String corpid, @Param("formId") Long formId, @Param("sortMap") Map<Long,Integer> sortMap);
}
